


<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/inc/sessionCheck.jsp" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>
<%@ taglib uri="/WEB-INF/config/tld/fmt.tld" prefix="fmt" %>
<%@ taglib uri="http://ssh.org/selects" prefix="ssh"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
String applicationPath = basePath + "/" + "application";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="<%=path%>/css/jinmu_style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="<%=path%>/js/util.js"></script>
</head>
<body>
<html:form styleId="baseData" action="baseManage_listBaseData.do?method=listBaseData">
     <input type="hidden" id="totalPage" value="${totalPage}"/>
     <table cellspacing="0" cellpadding="0" width="98%" align="center"  border="0" class="margtb5">
	    <tr>
	      <td align="left" class="padl5 lan12"><img src="<%=path%>/images/img-11.gif" width="12" height="12">&nbsp;系统管理&nbsp;>&nbsp;基础数据管理</td>
	    </tr>
	 </table>
	 <table cellspacing="3" cellpadding="0" width="98%" align="center"  border="0" class="kuang2 margtb5 hei12">
		<tr>
		    <td width="3%" align="right">字典类型：</td>
	           <td width="10%">
		               <html:text property="typeName" styleClass="text1"></html:text>
		                         		   		   </td>
                   		  

                   		  <td width="22%"><input class="buttonbg"   id="but_query" type="button" value="<bean:message key='com.application.systemmanager.query'/>" name="but_query" onClick="query();" /></td>
		</tr>
	</table>
   

    <table cellspacing="0" cellpadding="0" width="98%" align="center"  border="0" class="margb5">
      <tr>
        <td colspan="8" class="bgcolor2 padlr5">
          <table border="0" cellspacing="0" cellpadding="0" class="lan13b">
	    <tr>
		  <td width="25" align="center"><img src="<%=applicationPath%>/images/tianjia.gif" alt="<bean:message key='com.application.systemmanager.add'/>" height="15" width="15" /></td>
		  <td class="lieb-zi" width="40"><a href="baseManage_toAddBaseData.do?method=toAddBaseData"  >新增</a></td>
		  <td width="25" align="center"><img src="<%=applicationPath%>/images/114.gif" alt="加载数据字典"  height="15" width="15" /></td>
		  <td class="lieb-zi" width="400"><a href="#" onclick="javascript:document.location='loadBaseData.do?method=loadBaseData'"  >加载数据字典</a></td>
	   </tr>
	</table> 
   </td>
 </tr>
			<tr>
				<td>
		<fmt:bundle basename="com.application.systemmanager.struts.ApplicationResources">
										<display:table name="baseDataLL" partialList="true" class="simple" id="baseData"
											defaultsort="1" defaultorder="descending"
											requestURI="baseManage_listBaseData.do?method=listBaseData" size="resultSize" pagesize="10">
											 
							
											<display:column property="typeName" title="字典类型"
												sortable="false" style="width:5%; text-align:center;" maxLength="10" />
											<display:column property="remark" title="备注" sortable="false"
												style="width:5%; text-align:center;" maxLength="10" />
												
												
			
											<display:column title="查看" style="width:5%; text-align:center;">
												<c:url var="url" scope="page"
													value="baseManage_listBaseDataList.do">
													<c:param name="method" value="listBaseDataListForBaseDataID" />
													<c:param name="TId" value="${baseData.id}" />
												</c:url>
												<html:link action="${url}">查看</html:link>
											</display:column>
											<display:column title="操作" style="width:5%; text-align:center;">
												<c:url var="url" scope="page"
													value="baseManage_toUpdateBaseData.do">
													<c:param name="method" value="toUpdateBaseData" />
													<c:param name="id" value="${baseData.id}" />
												</c:url>
												<html:link action="${url}">更新</html:link>
												<c:url var="url" scope="page"
													value="baseManage_delBaseData.do">
													<c:param name="id" value="${baseData.id}" />
													<c:param name="method" value="delBaseData" />
												</c:url>
												<html:link action="${url}">删除</html:link>
											</display:column>
										</display:table>
											</fmt:bundle>
				</td>
			</tr>
		</table>

     </html:form>
	</body>
</html>
<script>

function query(){
	document.forms[0].action="baseManage_listBaseData.do?method=listBaseData";
	document.forms[0].submit();
}

//新增
function addAllowance(){
    document.forms[0].action="toAddAllowance.do?method=toAddAllowance";
	document.forms[0].submit();
}

//修改
function modifyAllowance(){
    var result = validateSelect();
	if(result==0){
		alert("请选择一条记录！");
		return;
	}else if(result>1){
	        alert("一次只能编辑一条记录！");
		return;
	}else{
		document.forms[0].action="toUpdateAllowance.do?method=toUpdateAllowance";
	        document.forms[0].submit();
	}
	
}

//删除
function delAllowance()
{
	var ids = getSelectedIds('id');
	if( ids=="" )
	{
		alert("请选择一条记录！");
		return false;
	}
	if( confirm("是否要删除所选的信息？") )
	{
		document.forms[0].action="deleteAllowance.do?method=deleteAllowance&ids=" + ids;
		document.forms[0].submit();
	}
}
	
	
function validateSelect(){ 
    var count = 0;
    var jysBox = $s("id");
    for(var i=0;i<jysBox.length;i++){
		if(jysBox[i].checked){
        	count++;
		}
	}
    return count;
}

//查看
function view(id){
	document.forms[0].action="baseManage_listBaseDataList.do?method=listBaseDataListForBaseDataID?TId=" + id;
    document.forms[0].submit();

}

function viewAllowance(id){
   document.forms[0].action="viewAllowance.do?method=viewAllowance&id=" + id;
   document.forms[0].submit();
}

//全选   
function checkAll()   
{ 
  
   var chk=document.getElementsByName("id");   
   for(var i=0;i<chk.length;i++)   
   { 
     if($('checkall').checked){
     	chk(i).checked=true; 
     }else{
        chk(i).checked=false; 
     } 
       
 }
  
}   
</script>
